home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 924 b | 49 lines | [TEXT/CWIE] |
- // List.h
-
- #ifndef List_h
- #define List_h
-
- #ifndef Sequence_h
- #include "Sequence.h"
- #endif
-
- class ListNode;
- template <class Head, class Node> class SequenceLoop;
-
- class List: public Sequence<List,ListNode>
- {
- public:
- typedef ListNode Node;
- typedef SequenceLoop<List,ListNode> Loop;
-
- private:
- Node *first;
- Node *last;
-
- public:
- List();
- ~List();
-
- const Node *First() const { return first; }
- const Node *Last() const { return last; }
-
- Node *First() { return first; }
- Node *Last() { return last; }
-
- bool IsEmpty() const { return first == 0; }
-
- void Add( Node&, BeforeStart );
- void Add( Node&, AfterEnd );
-
- void Add( Node&, Before, const Node& position );
- void Add( Node&, After, const Node& position );
-
- void Add( Node&, Before, const Loop& position );
- void Add( Node&, After, const Loop& position );
-
- void Remove( Node& );
- void RemoveAll();
- };
-
- #endif
-